package com.qianmo.jinxiaocun.fu.chart;

import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;

/**
 * author : wizardev
 * e-mail : wizarddev@163.com
 * time   : 2017/10/12
 * desc   : 设置x轴的标签
 * version: 1.0
 */
public class MyXAxisValueFormatter implements IAxisValueFormatter {

    private String[] mValues;

    public MyXAxisValueFormatter(String[] values) {
        this.mValues = values;
    }

    @Override
    public String getFormattedValue(float value, AxisBase axis) {
        // "value" represents the position of the label on the axis (x or y)
        return mValues[(int) value];
    }

    /** this is only needed if numbers are returned, else return 0 */
  //  @Override
  //  public int getDecimalDigits() { return 0; }
}
